<template>
<div>


   <el-row   >
  <el-col :span="24"  v-for="(newes,index) in news" :key="newes.id" >
    <el-card :body-style="{ padding: '24px'}"  v-for="(stories,index) in newes.stories" :key="stories.id">
          <el-card :body-style="{ padding: '24px'}"  v-for="(images,index) in stories.images" :key="images.id">
          <img :src='images'></img>
          <li>{{stories.title}}</li>
          </el-card>
      <div style="padding: 24px;">
        
        <div class="bottom clearfix">
          <time class="time">{{ currentDate }}</time>
          
        </div>
      </div>
    </el-card>
  </el-col>
</el-row>


 <div class="block">
  
  <el-pagination
    layout="prev, pager, next"
    :total="1000">
  </el-pagination>
</div>
</div>

</template>
<script>
import axios from 'axios';
export default {
  data() {
    var news=[];
    return {
      msg: 'Welcome to Your Vue.js App',
      currentDate: new Date(),
      news:[],
    };
  },
  mounted() {
    var instance = axios.create({
      headers:{"content-type":"application/x-www-form-urlencoded"}
    })
    instance.get('/api/4/news/latest')
                .then((response) => {  
                      this.news.push(response.data);
                      console.log(this.news);
                                 
                })
                .catch((error) => {
                  console.log(error);
                });
  },
};
</script>
<style>
#body{
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
 .text {
    font-size: 14px;
  }

  .item {
    padding: 18px 0;
  }
  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  .clearfix:after {
      clear: both
  }

  .box-card {
    width: 480px;
    height:200px; 
  }
  .time {
    font-size: 13px;
    color: #999;
  }
  
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  
  .clearfix:after {
      clear: both
  }
   .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
     background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
     background-color: #63B8FF;
  }

</style>
